﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="quote-results-details.aspx.cs" Inherits="car_insurance_quote_results_details" %>

<%@ Register Src="~/controls/usrNoJS.ascx" TagName="usrNoJS" TagPrefix="ucNoJS" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%--<%@ Register Src="~/controls/usrPhoneNo.ascx" TagName="usrPhoneNo" TagPrefix="uc1" %>--%>
<%@ Register Src="~/controls/usrMobilePhone.ascx" TagName="usrMobileNo" TagPrefix="uc1" %>
<%@ Register Src="~/controls/usrIdNumber.ascx" TagName="usrIdNumber" TagPrefix="uc2" %>
<%@ Register Src="~/controls/usrDate.ascx" TagName="usrDate" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="/css/forms_results.css" rel="stylesheet" type="text/css" />

    <script src="/includes/LoadingProgress.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpHeader" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpBody" runat="Server">
    <div id="container">
        <div class="body">
            <div class="topcol">
            </div>
            <div class="body">
                <div class="padding_lr15px">
                    <!--Column Content | Start-->
                    <div class="col_content_full">
                        <div class="topcol">
                        </div>
                        <div class="body">
                            <div class="padding_lr30px">
                                <div class="elements_inner_wrapper">
                                    <ucNoJS:usrNoJS ID="usrNoJS1" runat="server" />
                                    <!-- #Include file="../includes/body_loader.inc" -->
                                    <div class="seperator">
                                    </div>

                                    <script type="text/javascript">
                                        IncreaseProgress(10);
                                    </script>

                                    <div id="divContent" style="display: none;">
                                        <div class="tx_title21 uppercase">
                                            <%=GetGlobalResourceObject("CarInsuranceResultPage", "ComparisonDetail")%>
                                        </div>
                                        <table cellpadding="0" cellspacing="0" border="0" class="table_details" id="tblCarDetails"
                                            runat="server">
                                            <tr id="trTop" runat="server">
                                                <td class="w312px">
                                                </td>
                                            </tr>
                                            <tr id="trProvider" runat="server">
                                                <td>
                                                </td>
                                            </tr>
                                            <tr id="trPlan" runat="server">
                                                <td class="pad7px txtleft">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "Insurer")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trPrice" runat="server">
                                                <td class="bg_grey_5 txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "TotalVMI")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trExcess" runat="server">
                                                <td class="border1pxdotb_light txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "DEC")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trWorkshop" runat="server">
                                                <td class="txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "OwnDamage")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trPA" runat="server">
                                                <td class="txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "Fire")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trPA2" runat="server">
                                                <td class="border1pxdotb_light txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "Theft")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trMedExp" runat="server">
                                                <td class="border1pxdotb_light txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "TPPD")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trLossPE" runat="server">
                                                <td class="txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "TPBIA")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trLossOfUse" runat="server">
                                                <td class="txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "TPBIP")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trWorkshopPDF" runat="server">
                                                <td class="border1pxdotb_light txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "PADriver")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trPolicy" runat="server">
                                                <td class="border1pxdotb_light txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "MED")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trEndorsement" runat="server">
                                                <td class="txtleft pad7px">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "BailBond")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trBottom" runat="server">
                                                <td>
                                                </td>
                                            </tr>
                                        </table>
                                        <div class="seperator_15px">
                                        </div>
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td runat="server" id="tdBarLeft">
                                                </td>
                                                <td class="txtcenter" align="center">
                                                    <div class="hilite" id="divBar" runat="server">
                                                        <div class="left">
                                                        </div>
                                                        <div class="content txtcenter" style="float: left;" id="divCenterBar" runat="server">
                                                            <div class="pad7px">
                                                                <strong>
                                                                    <%=GetGlobalResourceObject("CarInsuranceResultPage", "Interested")%></strong></div>
                                                        </div>
                                                        <div class="right" style="">
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>

                                        <script type="text/javascript">
                                            IncreaseProgress(35);
                                        </script>

                                        <table cellpadding="0" cellspacing="1" width="100%" border="0" class="table_details"
                                            id="tblArrows">
                                            <tr id="trArrows" runat="server">
                                                <td class="w312px">
                                                </td>
                                            </tr>
                                        </table>
                                        <div class="seperator">
                                        </div>

                                        <script type="text/javascript">
                                            IncreaseProgress(50);
                                        </script>

                                        <table cellpadding="0" cellspacing="0" border="0" class="table_details" id="tblOptions">
                                            <tr id="trTopOptions" runat="server">
                                                <td class="w480px" runat="server" id="tdTopPad">
                                                </td>
                                            </tr>
                                            <tr id="trBuyOnline" runat="server">
                                                <td class="pad7px txtleft border1pxdotb_light">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "BuyOnline")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trCallMe" runat="server">
                                                <td class="pad7px txtleft border1pxdotb_light">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "CallMe")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trEmailMe" runat="server">
                                                <td class="pad7px txtleft border1pxdotb_light">
                                                    <strong>
                                                        <%--<%=GetGlobalResourceObject("CarInsuranceResultPage", "EmailMe")%>--%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trEmailThis" runat="server" style="display: none;">
                                                <td class="pad7px txtleft">
                                                    <strong>
                                                        <%=GetGlobalResourceObject("CarInsuranceResultPage", "EmailThis")%></strong>
                                                </td>
                                            </tr>
                                            <tr id="trBottomOptions" runat="server">
                                                <td>
                                                </td>
                                            </tr>
                                        </table>

                                        <script type="text/javascript">
                                            IncreaseProgress(75);
                                        </script>

                                        <div class="seperator">
                                        </div>
                                        <div class="seperator">
                                        </div>
                                        <div class="seperator_dashed">
                                        </div>
                                        <div class="seperator">
                                        </div>
                                        <asp:Button runat="server" ID="btnBack" Visible="true" onmousedown="this.className = 'button_back_mousedown';"
                                            onmouseup="this.className = 'button_back';" onmouseout="this.className = 'button_back';"
                                            CssClass="button_back" CausesValidation="false" OnClientClick="this.removeAttribute('onmouseout'); this.removeAttribute('onmouseup'); this.className = 'button_processing';"
                                            OnClick="btnBack_Click" />
                                        <div style="display: none;">
                                            <asp:LinkButton runat="server" ID="lnkbtnPopup" Text="click"></asp:LinkButton>
                                            <input id="inputProviderId" runat="server" type="hidden" />
                                            <input id="inputCarResultId" runat="server" type="hidden" />
                                            <input runat="server" id="inputCallMeMakeModel" type="hidden" />
                                            <input runat="server" id="inputCallMeCompanyName" type="hidden" />
                                        </div>
                                        <cc1:ModalPopupExtender ID="mpePopup" runat="server" DropShadow="true" PopupControlID="pnlPopup"
                                            BackgroundCssClass="modalBackground" TargetControlID="lnkbtnPopup" CancelControlID="btnClose"
                                            BehaviorID="mdlPopup">
                                        </cc1:ModalPopupExtender>
                                        <!--Call to Action Popup | Start-->
                                        <asp:Panel ID="pnlPopup" runat="server" Style="display: none; background: white;"
                                            Width="595px">
                                            <div id="divPopup" style="padding: 10px; padding-top: 0px; height: auto">
                                                <div style="width: 100%; height: 40px; text-align: right; margin-top: 3px;">
                                                    <div class="bg_grey_5 pad5px txtright" style="width: 560px; text-align: right;">
                                                        <a href="results.aspx" name="ctl00$ContentPlaceHolder1$btnClose" onclick="HidePanel();"
                                                            id="ctl00_ContentPlaceHolder1_btnClose">
                                                            <img src="/images/spacer.gif" id="btnClose" border="0" class="button_close" width="75"
                                                                height="30" alt="Close" /></a>
                                                    </div>
                                                </div>
                                                <div style="margin-left: 15px; margin-top: 20px;">
                                                    <asp:Image ID="imgProvider" runat="server" Width="100px" AlternateText="" /><br />
                                                </div>
                                                <table cellpadding="0" cellspacing="0" border="0" class="table_details" style="width: 580px;">
                                                    <tr>
                                                        <td width="220">
                                                        </td>
                                                        <td class="bg_grey_2" width="360">
                                                            <div>
                                                                <div class="curvetopleft left">
                                                                </div>
                                                                <div class="curvetopright right">
                                                                </div>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="txtleft pad7px border1pxdotb_light">
                                                            <strong>
                                                                <%= GetGlobalResourceObject("CarInsuranceResultPage", "YourFullName")%></strong>
                                                        </td>
                                                        <td class="bg_grey_2 pad7px border2pxdotb">
                                                            <asp:TextBox ID="txtFullName" Width="250" MaxLength="80" runat="server" ReadOnly="true"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="txtleft pad7px border1pxdotb_light">
                                                            <strong>
                                                                <%= GetGlobalResourceObject("CarInsuranceResultPage", "YourEmail")%></strong>
                                                        </td>
                                                        <td class="bg_grey_2 pad7px border2pxdotb">
                                                            <asp:TextBox ID="txtEmail" runat="server" Width="250" MaxLength="100" ReadOnly="true"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="txtleft pad7px border1pxdotb_light">
                                                            <strong>
                                                                <%= GetGlobalResourceObject("CarInsuranceResultPage", "YourMobileNumber")%></strong>
                                                        </td>
                                                        <td class="bg_grey_2 pad7px border2pxdotb">
                                                            <uc1:usrMobileNo ID="txtMobileNo" IsEnabled="true" IsRequired="true" PhoneNoRequireErrorMessage="Require mobile number."
                                                                PhoneNoErrorMessage="Mobile phone number should 8 digits." PhoneNoValidErrorMessage="Invalid mobile phone number."
                                                                runat="server" ValidationGroup="requestoptions" IsReadOnly="true" />
                                                        </td>
                                                    </tr>
                                                    <tr id="trCallMeOptions" style="display: none;">
                                                        <td class="txtleft pad7px border1pxdotb_light">
                                                            <strong>
                                                                <%= GetGlobalResourceObject("CarInsuranceResultPage", "CallMeAt")%></strong>
                                                        </td>
                                                        <td class="bg_grey_2 pad7px border2pxdotb">
                                                            <asp:DropDownList CssClass="blue" Font-Size="12px" runat="server" ID="ddlCallMeTime">
                                                                <asp:ListItem Value="-1" Text="<%$Resources:CarInsurance,Select %>" />
                                                                <asp:ListItem Value="1" Text="<%$Resources:CarInsurance,CallMeMorning %>" />
                                                                <asp:ListItem Value="2" Text="<%$Resources:CarInsurance,CallMeAfternoon %>" />
                                                                <asp:ListItem Value="3" Text="<%$Resources:CarInsurance,CallMeEvening %>" />
                                                                <asp:ListItem Value="4" Text="<%$Resources:CarInsurance,CallMeAnytime %>" />
                                                            </asp:DropDownList>
                                                            <asp:RequiredFieldValidator ID="rfvCallMeTime" runat="server" CssClass="validationErrorControl"
                                                                ValidationGroup="callme" ErrorMessage="" Text="" InitialValue="-1" ControlToValidate="ddlCallMeTime"></asp:RequiredFieldValidator>
                                                        </td>
                                                    </tr>
                                                    <tr id="trCallMePopup" style="display: none;">
                                                        <td class="txtleft pad7px">
                                                            <strong>
                                                                <%= GetGlobalResourceObject("CarInsuranceResultPage", "YourPreference")%></strong>
                                                        </td>
                                                        <td class="bg_grey_2 pad7px">
                                                            <asp:Button runat="server" ID="btnCallMe" CssClass="button_call-me" OnClick="btnCallMe_Click"
                                                                ValidationGroup="callme" OnClientClick="LoadValidationErrorCss(); if (Page_ClientValidate('callme')){this.className = 'button_processing';}" />
                                                        </td>
                                                    </tr>
                                                    <tr id="trEmailMePopup" style="display: none;">
                                                        <td class="txtleft pad7px">
                                                            <strong>
                                                                <%= GetGlobalResourceObject("CarInsuranceResultPage", "YourPreference")%></strong>
                                                        </td>
                                                        <td class="bg_grey_2 pad7px">
                                                            <asp:Button runat="server" ID="btnEmailMe" CssClass="button_email-me" OnClick="btnEmailMe_Click"
                                                                OnClientClick="this.className = 'button_processing';" />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        </td>
                                                        <td class="bg_grey_2 w210px">
                                                            <div>
                                                                <div class="curvebottomleft left">
                                                                </div>
                                                                <div class="curvebottomright right">
                                                                </div>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </asp:Panel>
                                        <!--Learn More Popup | End-->
                                    </div>

                                    <script type="text/javascript">
                                        IncreaseProgress(95);
                                    </script>

                                </div>
                            </div>
                        </div>
                        <div class="bottom">
                        </div>
                    </div>
                    <!--Column Content | End-->
                </div>
            </div>
            <div class="bottom">
            </div>
        </div>
    </div>

    <script type='text/javascript'>

        function HidePanel() {
            document.getElementById('<%=pnlPopup.ClientID%>').style.display = 'none';
        }

        function ShowPopup(_companyId, _carResultId, _companyName, _isCallMe) {

            document.getElementById('<%=inputProviderId.ClientID%>').value = _companyId;
            document.getElementById('<%=inputCarResultId.ClientID%>').value = _carResultId;
            document.getElementById('<%=inputCallMeCompanyName.ClientID%>').value = _companyName;

            if (_isCallMe == 'true') {
                document.getElementById('trCallMeOptions').style.display = '';
                document.getElementById('trCallMePopup').style.display = '';
                document.getElementById('trEmailMePopup').style.display = 'none';
            }
            else {
                document.getElementById('trCallMeOptions').style.display = 'none';
                document.getElementById('trCallMePopup').style.display = 'none';
                document.getElementById('trEmailMePopup').style.display = '';
            }

            imgurl = '';
            document.getElementById('<%=imgProvider.ClientID%>').src = '/images/public/logo/hsbc.png';

            if (_companyId == '11') {
                imgurl = '/images/public/logo/allianz.png';
            }
            else if (_companyId == '12') {
                imgurl = '/images/public/logo/msig.png';
            }
            else if (_companyId == '16') {
                imgurl = '/images/public/logo/axa.png';
            }
            else if (_companyId == '29') {
                imgurl = '/images/public/logo/lmg.png';
            }
            else if (_companyId == '31') {
                imgurl = '/images/public/logo/chartis.png';
            }
            else if (_companyId == '33') {
                imgurl = '/images/public/logo/muangthai.png';
            }
            else if (_companyId == '41') {
                imgurl = '/images/public/logo/kurnia.png';
            }            
            else {
                imgurl = '/images/public/logo/bangkok-insurance.png';
            }

            document.getElementById('<%=imgProvider.ClientID%>').src = imgurl;

            var modpop = $find("mdlPopup");
            if (!modpop) { return; }
            modpop.show();
        }

        function OKNOW() {
            alert('ok');
        }
        
        function ValidateRedirect(companyid) {
            
            var urlstring = "";
            
            switch (companyid) {
                case '11':
                    urlstring = "http://www.allianzcp.com/claims_map.jsp";
                    break;
                case '12':
                    urlstring = "http://www.msig-thai.com/msig/html/article.aspx?contentid=77";
                    break;
                case '16':
                    urlstring = "http://www.axa.co.th/viewdownload.aspx?file=222fi_578.xls&ofile=AXA+Garage+List.xls";
                    break;
                case '29':
                    urlstring = "http://www.lmginsurance.co.th/th/03-claim-service/08-claim-repair-garage.aspx";
                    break;
                case '31':                    
                    urlstring = "http://www.gluaygluay.com/policy-docs/chartis/garage-list-New(Update)-JAN12.xls";
                    break;
                case '32':
                    urlstring = "http://www.bangkokinsurance.com/home/garage.asp?key=62&region_code=MD";
                    break;
                case '33':
                    urlstring = "http://www.mtins.com/web/garagemtiS1.php";
                    break;
                case '41':
                    urlstring = "http://thailand.kurnia.com/Insurance/LocatorsIndex/Default.aspx";                    
                    break;
            }

            if (urlstring != '') {                
                window.open(urlstring);
                return true;
            }


        }
        function OpenWorkshop(coid) {

            var winl = (screen.width - 840) / 2;
            var wint = (screen.height - 500) / 2;
            var settings = 'height=500,';
            settings += 'width=840,';
            settings += 'top=' + wint + ',';
            settings += 'left=' + winl + ',';
            settings += 'scrollbars=yes,';
            settings += 'resizable=No';
            window.open('ViewProviderWorkShop.aspx?comid=' + coid, 'NEWWIN', settings);
        }

        IncreaseProgress(100);
        HideLoading();
                     
    </script>

</asp:Content>
